

package traffic.light.simulator.town.trafficLight;

import traffic.light.simulator.town.unity.CrossRoadType;

/**
 *
 * Class of Trafficlight which change with pedestrian
 */
public class PedestrianTrafficLight extends TrafficLight implements IPedestrianTrafficLight {

    public PedestrianTrafficLight(int xTU, int yTU,CrossRoadType type) {
        super(xTU, yTU,type);
    }

    @Override
    public void CallFromPedestrian() {
        this.change();
        Thread t=new Thread(new Runnable() {

            @Override
            public void run() {
                int i=0;
                    try {
                        Thread.sleep(2000);
                    } catch (InterruptedException ex) {
                        System.out.println(ex);
                    }
                    changeAllIn(true);
            }
        });
        t.start();
    }


    
  
}
